var { Server } = require('socket.io');
var log4js = require('log4js');
var USERCOUNT=3;
//初始化scoket信令服务
function ioinit (https_server) {
  // console.log(log4js);
  return new Server(https_server);
}
//日志记录
log4js.configure({
  appenders: {
    file: {
      type: 'file',//file console
      filename: './logs/app.log',
      layout: {
        type: 'pattern',
        pattern: '%h %d{yyyy-MM-dd hh:mm:ss.SSS} %p - %m',
      },
    },

  },
  categories: {
    default: {
      appenders: ['file'],
      level: 'debug'
    }
  }
});
let logger = log4js.getLogger()



module.exports = {
  ioinit,
  logger,
  USERCOUNT
}

